#page_box_wide
  %h1.page_title
    = "#{link_to "Home", "/"} > #{link_to "Administrate", "/admins"} > Users"
  .create_link
    = link_to "#{image_tag("icons/plus.gif", :alt => "")} New User", :action => :new_user
  .menu
    = render :partial => "menu"
  %br{:style => "clear:both;"}
  %table
    %tr
      %th Login
      %th Name
      %th Last Login
      %th Login IP 
      %th Type
      %th
    - for user in @users.reverse
      %tr
        %td
          = link_to user.login, :action => :edit_user, :id => user.id
        %td
          =h user.name
        %td
          = "#{time_ago_in_words(user.last_login_at)} ago" if user.last_login_at
        %td
          = user.last_login_ip
        %td
          = "Administrator" if user.is_administrator
        %td{:align => "right"}
          = link_to image_tag("icons/edit.gif", :alt => "delete"), :action => :edit_user, :id => user.id
          = link_to image_tag("icons/lock.gif", :alt => "change password"), :action => :new_password, :id => user.id
          = link_to image_tag("icons/trash.gif", :alt => "delete"), { :action => :destroy_user, :id => user.id }, :confirm => "Are you sure you want to delete this user?"
  %br
  = will_paginate @users 
